import * as echarts from 'echarts'
const data1 = [0, 9, 12, 15, 13, 13, 15, 16, 22, 74, 32, 35, 64]
const data2 = [50, 34, 14, 41, 23, 13, 18, 26, 31, 23, 45, 17, 27]
const data3 = data1.map((v, k) => {
    return 100 - v - data2[k]
})
var data = [9025, 41064, 8754, 3100]
var lineData = [5190, 41275, 4034, 29000]
var xData = ['第一季度', '第二季度', '第三季度', '第四季度']
const color = ['#6af2ff', '#fff900', '#02ff00']

export const leftChart1 = {
    tooltip: {
        trigger: 'axis',
        backgroundColor: '#070724bf',
        borderColor: '#00ffea59',
        textStyle: {
            color: '#00FFEA',
            fontSize: 12
        }
        // formatter:()
    },
    backgroundColor: 'transparent', // 背景色
    color,
    grid: {
        left: '4%',
        right: '4%',
        bottom: '3%',
        top: '15%',
        containLabel: true
    },
    xAxis: {
        data: xData,
        triggerEvent: true,
        axisTick: {
            show: false
        },
        axisLine: {
            show: false
        },
        axisLabel: {
            show: true,
            rotate: 0,
            interval: 0,
            textStyle: {
                fontSize: 12,
                color: 'rgba(255,255,255,1)'
            }
        }
    },

    yAxis: {
        triggerEvent: true,
        name: '升',
        splitLine: {
            show: true,
            lineStyle: {
                color: 'rgba(255,255,255,.1)'
            }
        },
        axisTick: {
            show: false
        },
        axisLine: {
            show: false,
            lineStyle: {
                color: 'rgba(255,255,255,.1)'
            }
        },
        splitNumber: 5,
        axisLabel: {
            show: true,
            textStyle: {
                color: 'rgba(216, 252, 255, 1)',
                fontSize: 12
            }
        }
    },
    series: [
        {
            name: '本年季度含水量',
            barMinHeight: 10,
            barWidth: 100,
            type: 'pictorialBar',
            symbol: 'path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z',
            itemStyle: {
                normal: {
                    borderColor: 'rgba(106, 242, 255, 1)',
                    borderWidth: 5,
                    // 渐变色
                    barBorderColor: 'rgba(106, 242, 255, 1)',
                    color: new echarts.graphic.RadialGradient(0.5, 0.8, 0.55, [{
                        offset: 1,
                        color: 'rgba(106, 242, 255, 1)'
                    },
                    {
                        offset: 0.5,
                        color: 'rgba(106, 242, 255, .5)'
                    },
                    {
                        offset: 0,
                        color: 'rgba(106, 242, 255, .1)'
                    }
                    ])
                }
            },
            data: data,
            z: 10
        },
        {
            name: '去年季度含水量',
            type: 'line',
            data: lineData,
            itemStyle: {
                normal: {
                    color: '#E0E009'
                }
            }

        }

    ]
}
export const leftChart2 = {
    backgroundColor: 'transparent',
    tooltip: {
        trigger: 'axis',
        backgroundColor: '#070724bf',
        borderColor: '#00ffea59',
        textStyle: {
            color: '#00FFEA',
            fontSize: 12
        }
        // formatter:()
    },
    grid: {
        left: '1%',
        right: '4%',
        bottom: '6%',
        top: 30,
        padding: '0 0 10 0',
        containLabel: true,
    },
    legend: {//图例组件，颜色和名字
        right: 10,
        top: 0,
        itemGap: 16,
        itemWidth: 18,
        itemHeight: 10,
        data: [{
            name: '流入',
            //icon:'image://../wwwroot/js/url2.png', //路径
        },
        {
            name: '流出',
        }],
        textStyle: {
            color: '#a8aab0',
            fontStyle: 'normal',
            fontFamily: '微软雅黑',
            fontSize: 12,
        }
    },
    xAxis: [
        {
            type: 'category',
            boundaryGap: true,//坐标轴两边留白
            data: ['榆林市', '榆阳区', '神木县', '府谷县', '横山县', '靖边县', '定边县', '绥德县', '米脂县', '佳　县', ],
            axisLabel: { //坐标轴刻度标签的相关设置。
                interval: 0,//设置为 1，表示『隔一个标签显示一个标签』
                margin: 15,
                textStyle: {
                    color: '#078ceb',
                    fontStyle: 'normal',
                    fontFamily: '微软雅黑',
                    fontSize: 12,
                }
            },
            axisTick: {//坐标轴刻度相关设置。
                show: false,
            },
            axisLine: {//坐标轴轴线相关设置
                lineStyle: {
                    color: '#fff',
                    opacity: 0.2
                }
            },
            splitLine: { //坐标轴在 grid 区域中的分隔线。
                show: false,
            }
        }
    ],
    yAxis: [
        {
            type: 'value',
            splitNumber: 5,
            axisLabel: {
                textStyle: {
                    color: '#a8aab0',
                    fontStyle: 'normal',
                    fontFamily: '微软雅黑',
                    fontSize: 12,
                }
            },
            axisLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: ['#fff'],
                    opacity: 0.06
                }
            }

        }
    ],
    series: [
        {
            name: '流入',
            type: 'bar',
            data: [4.9, 7.3, 9.2, 5.6, 7.7, 5.6, 4.2, 3.6, 6, 6.4,],
            barWidth: 20,
            barGap: 0,//柱间距离
            label: {//图形上的文本标签
                normal: {
                    show: true,
                    position: 'top',
                    textStyle: {
                        color: '#a8aab0',
                        fontStyle: 'normal',
                        fontFamily: '微软雅黑',
                        fontSize: 12,
                    },
                },
            },
            itemStyle: {//图形样式
                normal: {
                    barBorderRadius: [10, 10, 0, 0],
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0, color: '#FDB36A'
                    }, {
                        offset: 1, color: '#FDB36A00'
                    }], false),
                },
            },
        },
        {
            name: '流出',
            type: 'bar',
            data: [2.9, 5, 4.4, 2.7, 5.7, 4.6, 1.2, 2.7, 4.8, 6.0,],
            barWidth: 20,
            barGap: 0.2,//柱间距离
            label: {//图形上的文本标签
                normal: {
                    show: true,
                    position: 'top',
                    textStyle: {
                        color: '#a8aab0',
                        fontStyle: 'normal',
                        fontFamily: '微软雅黑',
                        fontSize: 12,
                    },
                },
            },
            itemStyle: {//图形样式
                normal: {
                    barBorderRadius: [10, 10, 0, 0],
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 0, color: '#9E87FF'
                    }, {
                        offset: 1, color: '#9E87FF00'
                    }], false),
                },
            },
        }
    ]
}